#include "sourcesignal.h"
#include <iostream>

namespace biosignal {

using std::cout;
using std::endl;
using std::string;

SourceSignalType::SourceSignalType() {

}
SourceSignalType::~SourceSignalType() {

}

SourceSignal::SourceSignal() {
	//	cout << "signal  created " << endl;
}

SourceSignal::SourceSignal(string label, string transducer_type,
		string physical_dimension, string filter_information) :
	m_label(label), m_transducer_type(transducer_type), m_physical_dimension(
			physical_dimension), m_filter_information(filter_information) {
	m_enabled = true;
	//	cout << "signalinfo created : " << label << endl;

}

SourceSignal::~SourceSignal() {
	delete m_signal_type;
	//	cout << "signalinfo deleted : " << label_ << endl;
}

const Position& SourceSignal::position() const {
	if(!m_position.defined && m_signal_type)
		return m_signal_type->get_std_position(m_label);
	return m_position;
}

void SourceSignal::position(const Position& position) {
	m_position = position;
}

const SourceSignalType* SourceSignal::type() const {
	return m_signal_type;
}

void SourceSignal::type( SourceSignalType* type ){
	m_signal_type = type;
}

string SourceSignal::label() const {
	return m_label;
}

void SourceSignal::label(string label) {
	m_label = label;
}

string SourceSignal::transducer_type() const {
	return m_transducer_type;
}
string SourceSignal::physical_dimension() const {
	return m_physical_dimension;
}
string SourceSignal::filter_information() const {
	return m_filter_information;
}

double SourceSignal::sample_rate() const {
	return m_sample_frequency;
}
bool SourceSignal::enabled() const {
	return m_enabled;
}
}
